INSERT INTO "Lookup" ("LookupId", "Name", "Description")VALUES (18, 'ScanCategory', 'Scan category types.');
INSERT INTO "Lookup" ("LookupId", "Name", "Description")VALUES (19, 'ScanSubCategory', 'Scan Sub category types.');

-- Table: public."ScanMachineAvailability"

-- DROP TABLE public."ScanMachineAvailability";

CREATE TABLE public."ScanMachineAvailability"
(
    "ScanMachineAvailabilityId" serial integer NOT NULL ,
    "ScanMachineMasterId" integer,
    "RoomName" character varying(250) COLLATE pg_catalog."default",
    "AvailableDays" character varying(14) COLLATE pg_catalog."default",
    "Availability" text COLLATE pg_catalog."default",
    "LocationId" integer,
    "Active" boolean DEFAULT true,
    "CreatedBy" integer,
    "CreatedDate" timestamp without time zone,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp without time zone,
    "FromDate" timestamp(6) without time zone,
    "ToDate" timestamp(6) without time zone,
    CONSTRAINT "ScanMachineAvailability_pkey" PRIMARY KEY ("ScanMachineAvailabilityId"),
    CONSTRAINT "ScanMachineAvailability_CreatedBy_fkey" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "ScanMachineAvailability_LocationId_fkey" FOREIGN KEY ("LocationId")
        REFERENCES public."Location" ("LocationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "ScanMachineAvailability_ModifiedBy_fkey" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "ScanMachineAvailability_ScanMachineMasterId_fkey" FOREIGN KEY ("ScanMachineMasterId")
        REFERENCES public."ScanMachineMaster" ("ScanMachineMasterId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public."ScanMachineAvailability"
    OWNER to postgres;
	
	----------------------------------------------------------------------------------------------------------------------------
	-- Table: public."BookScanAppointment"

-- DROP TABLE public."BookScanAppointment";

CREATE TABLE public."BookScanAppointment"
(
    "BookScanAppointmentId" serial integer NOT NULL ,
    "PatientId" integer,
    "PaymentStatus" boolean,
    "PayTypeId" integer,
    "LocationId" integer,
    "Active" boolean DEFAULT true,
    "CreatedBy" integer,
    "CreatedDate" timestamp without time zone,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp without time zone,
    "ScanMachineMasterId" integer,
    "AppointmentDate" date,
    "AppointmentTime" time(6) without time zone,
    "PaymentNumber" character varying COLLATE pg_catalog."default",
    "ScanTestMasterId" integer,
    CONSTRAINT "BookScanAppointment_pkey" PRIMARY KEY ("BookScanAppointmentId"),
    CONSTRAINT "BookScanAppointment_CreatedBy_fkey" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "BookScanAppointment_LocationId_fkey" FOREIGN KEY ("LocationId")
        REFERENCES public."Location" ("LocationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "BookScanAppointment_ModifiedBy_fkey" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "BookScanAppointment_PatientId_fkey" FOREIGN KEY ("PatientId")
        REFERENCES public."Patient" ("PatientId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "BookScanAppointment_PayTypeId_fkey" FOREIGN KEY ("PayTypeId")
        REFERENCES public."PayType" ("PayTypeId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "BookScanAppointment_ScanMachineMasterId_fkey" FOREIGN KEY ("ScanMachineMasterId")
        REFERENCES public."ScanMachineMaster" ("ScanMachineMasterId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public."BookScanAppointment"
    OWNER to postgres;
	---------------------------------------------------------------